home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
SHELLS
/
SZ2
/
ADEMO3.INC
< prev
next >
Wrap
Text File
|
1992-08-31
|
3KB
|
62 lines
{===================================================================
OPEN
===================================================================}
procedure hdOpen ;
var
D : PFileDialog ;
FileSpec : FNameStr ;
begin
FileSpec := '*.TXT' ;
New ( D , Init ( FileSpec , { FileSpec }
'Open file', { Dialog title }
'~N~ame' , { InputLine label }
fdOpenButton , { Buttons }
100 ) ) ; { History list }
if GENERAL.ExecDialog ( D , @FileSpec ) = cmCancel then EXIT ;
GENERAL.OpenEditor ( FileSpec , TRUE ) ;
end ;
{===================================================================
Simple version; uses only MSGBOX.MessageBox
===================================================================}
function EditorDialog ( Dialog : Integer ;
Info : Pointer ) : word ; FAR ;
var
R : TRect ;
T : TPoint ;
begin
case Dialog of
edOutOfMemory :
EditorDialog := MessageBox ( ^C'Not enough memory for this operation.' ,
NIL ,
mfError + mfOkButton ) ;
edReadError :
EditorDialog := MessageBox ( ^C'Error reading file %s.' ,
@Info ,
mfError + mfOkButton ) ;
edWriteError :
EditorDialog := MessageBox ( ^C'Error writing file %s.' ,
@Info ,
mfError + mfOkButton ) ;
edCreateError :
EditorDialog := MessageBox ( ^C'Error creating file %s.' ,
@Info ,
mfError + mfOkButton ) ;
edSaveModify :
EditorDialog := MessageBox ( ^C'%s has been modified. Save?' ,
@Info ,
mfInformation + mfYesNoCancel ) ;
edSaveUntitled :
EditorDialog := MessageBox ( ^C'Save untitled file?' ,
NIL ,
mfInformation + mfYesNoCancel ) ;
else
MessageBox ( ^C'Unknown DIALOG requested!' ,
NIL ,
mfError + mfOkButton ) ;
end ;
end ;